home *** CD-ROM | disk | FTP | other *** search
- /*
- File: CMApplication.h
-
- Copyright: © 1984-1994 by Apple Computer, Inc., all rights reserved.
-
- */
-
- #ifndef __CMAPPLICATION__
- #define __CMAPPLICATION__
-
- #ifndef __TYPES__
- #include <Types.h>
- /* #include <ConditionalMacros.h> */
- /* #include <MixedMode.h> */
- /* #include <Traps.h> */
- #endif
-
- #ifndef __QUICKDRAW__
- #include <Quickdraw.h>
- /* #include <QuickdrawText.h> */
- /* #include <IntlResources.h> */
- #endif
-
- #ifndef __PRINTING__
- #include <Printing.h>
- /* #include <Dialogs.h> */
- /* #include <Windows.h> */
- /* #include <Events.h> */
- /* #include <OSUtils.h> */
- /* #include <Controls.h> */
- /* #include <Menus.h> */
- /* #include <TextEdit.h> */
- #endif
-
- #define gestaltColorMatchingVersion 'cmtc'
-
- enum {
- gestaltColorSync10 = 0x0100,
- gestaltColorSync11 = 0x0110,
- gestaltColorSync104 = 0x0104,
- gestaltColorSync105 = 0x0105
- };
-
- #define gestaltColorMatchingAttr 'cmta'
-
- enum {
- gestaltHighLevelMatching = 0,
- gestaltColorMatchingLibLoaded = 1
- };
-
- #define CMTrap 0xABEE
-
- #define CMBeginProfile 220
-
- #define CMEndProfile 221
-
- #define CMEnableMatching 222
-
- #define CMDisableMatching 223
-
- #define kMatchCMMType 0x00000001
-
- #define kMatchApplProfileVersion 0x00000002
-
- #define kMatchDataType 0x00000004
-
- #define kMatchDeviceType 0x00000008
-
- #define kMatchDeviceManufacturer 0x00000010
-
- #define kMatchDeviceModel 0x00000020
-
- #define kMatchDeviceAttributes 0x00000040
-
- #define kMatchFlags 0x00000080
-
- #define kMatchOptions 0x00000100
-
- #define kMatchWhite 0x00000200
-
- #define kMatchBlack 0x00000400
-
- #define kCMApplProfileVersion 0x0100
-
- enum {
- rgbData = 'RGB ',
- cmykData = 'CMYK',
- grayData = 'GRAY',
- xyzData = 'XYZ '
- };
-
- enum {
- monitorDevice = 'mntr',
- scannerDevice = 'scnr',
- printerDevice = 'prtr',
- qdSystemDevice = 'sys ',
- qdGDevice = 'gdev'
- };
-
- enum {
- CMNativeMatchingPreferred = 0x00000001,
- CMTurnOffCache = 0x00000002
- };
-
- typedef long CMMatchFlag;
-
- enum {
- CMPerceptualMatch = 0x0000,
- CMColorimetricMatch = 0x0001,
- CMSaturationMatch = 0x0002
- };
-
- typedef long CMMatchOption;
-
- typedef long CMMatchRef;
-
- typedef long CWorld;
-
- enum {
- CMNoError = 0,
- CMProfileError = -170,
- CMMethodError = -171,
- CMMemFullError = -172,
- CMUnimplementedError = -173,
- CMParamError = -174,
- CMMethodNotFound = -175,
- CMProfileNotFound = -176,
- CMProfilesIdentical = -177,
- CMCantConcatenateError = -178,
- CMCantXYZ = -179,
- CMCantDeleteProfile = -180,
- CMUnsupportedDataType = -181,
- CMNoCurrentProfile = -182
- };
-
- typedef long CMError;
-
- #if powerc
- #pragma options align=mac68k
- #endif
- struct XYZColor {
- unsigned short X;
- unsigned short Y;
- unsigned short Z;
- };
- #if powerc
- #pragma options align=reset
- #endif
-
- typedef struct XYZColor XYZColor;
-
- #if powerc
- #pragma options align=mac68k
- #endif
- struct CMYKColor {
- unsigned short cyan;
- unsigned short magenta;
- unsigned short yellow;
- unsigned short black;
- };
- #if powerc
- #pragma options align=reset
- #endif
-
- typedef struct CMYKColor CMYKColor;
-
- #if powerc
- #pragma options align=mac68k
- #endif
- union CMColor {
- RGBColor rgb;
- XYZColor xyz;
- CMYKColor cmyk;
- };
- #if powerc
- #pragma options align=reset
- #endif
-
- typedef union CMColor CMColor, *CMColorList;
-
- typedef long *CMGamutResult;
-
- #if powerc
- #pragma options align=mac68k
- #endif
- struct CMHeader {
- unsigned long size;
- OSType CMMType;
- unsigned long applProfileVersion;
- OSType dataType;
- OSType deviceType;
- OSType deviceManufacturer;
- unsigned long deviceModel;
- unsigned long deviceAttributes[2];
- unsigned long profileNameOffset;
- unsigned long customDataOffset;
- CMMatchFlag flags;
- CMMatchOption options;
- XYZColor white;
- XYZColor black;
- };
- #if powerc
- #pragma options align=reset
- #endif
-
- typedef struct CMHeader CMHeader;
-
- #if powerc
- #pragma options align=mac68k
- #endif
- struct CMProfileSearchRecord {
- CMHeader header;
- unsigned long fieldMask;
- unsigned long reserved[2];
- };
- #if powerc
- #pragma options align=reset
- #endif
-
- typedef struct CMProfileSearchRecord CMProfileSearchRecord, **CMProfileSearchRecordHandle;
-
- #if powerc
- #pragma options align=mac68k
- #endif
- struct CMProfileChromaticities {
- XYZColor red;
- XYZColor green;
- XYZColor blue;
- XYZColor cyan;
- XYZColor magenta;
- XYZColor yellow;
- };
- #if powerc
- #pragma options align=reset
- #endif
-
- typedef struct CMProfileChromaticities CMProfileChromaticities;
-
- typedef unsigned short CMResponseData;
-
- #if powerc
- #pragma options align=mac68k
- #endif
- struct IString {
- ScriptCode theScript;
- Str63 theString;
- };
- #if powerc
- #pragma options align=reset
- #endif
-
- typedef struct IString IString, *IStringPtr, **IStringHandle;
-
- enum {
- grayResponse = 0,
- redResponse,
- greenResponse,
- blueResponse,
- cyanResponse,
- magentaResponse,
- yellowResponse,
- ucrResponse,
- bgResponse,
- onePlusLastResponse
- };
-
- typedef long responseColor;
-
- #if powerc
- #pragma options align=mac68k
- #endif
- struct CMProfileResponse {
- unsigned short counts[onePlusLastResponse];
- CMResponseData data[1];
- };
- #if powerc
- #pragma options align=reset
- #endif
-
- typedef struct CMProfileResponse CMProfileResponse;
-
- #if powerc
- #pragma options align=mac68k
- #endif
- struct CMProfile {
- CMHeader header;
- CMProfileChromaticities profile;
- CMProfileResponse response;
- IString profileName;
- char customData[1];
- };
- #if powerc
- #pragma options align=reset
- #endif
-
- typedef struct CMProfile CMProfile, *CMProfilePtr, **CMProfileHandle;
-
- typedef pascal Boolean (*PixMapCallBackProcPtr)(long progress, long refCon);
-
- enum {
- uppPixMapCallBackProcInfo = kPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
- };
-
- #if USESROUTINEDESCRIPTORS
- typedef UniversalProcPtr PixMapCallBackUPP;
-
- #define CallPixMapCallBackProc(userRoutine, progress, refCon) \
- CallUniversalProc((ProcPtr)userRoutine, uppPixMapCallBackProcInfo, progress, refCon)
- #define NewPixMapCallBackProc(userRoutine) \
- (PixMapCallBackUPP) NewRoutineDescriptor((ProcPtr)userRoutine, uppPixMapCallBackProcInfo, GetCurrentISA())
- #else
- typedef PixMapCallBackProcPtr PixMapCallBackUPP;
-
- #define CallPixMapCallBackProc(userRoutine, progress, refCon) \
- (*userRoutine)(progress, refCon)
- #define NewPixMapCallBackProc(userRoutine) \
- (PixMapCallBackUPP)(userRoutine)
- #endif
-
- enum {
- enableColorMatchingOp = 12,
- registerProfileOp = 13
- };
-
- #if powerc
- #pragma options align=mac68k
- #endif
- struct TEnableColorMatchingBlk {
- short iOpCode;
- short iError;
- long lReserved;
- THPrint hPrint;
- Boolean fEnableIt;
- };
- #if powerc
- #pragma options align=reset
- #endif
-
- typedef struct TEnableColorMatchingBlk TEnableColorMatchingBlk;
-
- #if powerc
- #pragma options align=mac68k
- #endif
- struct TRegisterProfileBlk {
- short iOpCode;
- short iError;
- long lReserved;
- THPrint hPrint;
- Boolean fRegisterIt;
- };
- #if powerc
- #pragma options align=reset
- #endif
-
- typedef struct TRegisterProfileBlk TRegisterProfileBlk;
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #define CMCall(selector, argsize) {0x203c,argsize,selector,CMTrap}
-
- extern pascal CMError BeginMatching(CMProfileHandle src, CMProfileHandle dst, CMMatchRef *myRef)
- FOURWORDINLINE(0x203c, 0x000C, 10, 0xABEE);
- extern pascal void EndMatching(CMMatchRef myRef)
- FOURWORDINLINE(0x203c, 0x0004, 11, 0xABEE);
- extern pascal CMError GetProfile(long deviceType, long refNum, CMProfileHandle aProfile, CMProfileHandle *returnedProfile)
- FOURWORDINLINE(0x203c, 0x0010, 5, 0xABEE);
- extern pascal CMError SetProfile(long deviceType, long refNum, CMProfileHandle newProfile)
- FOURWORDINLINE(0x203c, 0x000c, 6, 0xABEE);
- extern pascal CMError SetProfileDescription(long deviceType, long refNum, long deviceData, CMProfileHandle hProfile)
- FOURWORDINLINE(0x203c, 0x0010, 16, 0xABEE);
- extern pascal CMError GetColorSyncFolderSpec(short vRefNum, Boolean createFolder, short *foundVRefNum, long *foundDirID)
- FOURWORDINLINE(0x203c, 0x000c, 17, 0xABEE);
- extern pascal CMError GetIndexedProfile(long deviceType, long refNum, CMProfileSearchRecordHandle search, CMProfileHandle *returnProfile, long *index)
- FOURWORDINLINE(0x203c, 0x0014, 18, 0xABEE);
- extern pascal CMError DeleteDeviceProfile(long deviceType, long refNum, CMProfileHandle deleteMe)
- FOURWORDINLINE(0x203c, 0x000C, 19, 0xABEE);
- extern pascal CMError UseProfile(CMProfileHandle profile)
- FOURWORDINLINE(0x203c, 0x0004, 8, 0xABEE);
- extern pascal void DrawMatchedPicture(PicHandle myPicture, CMProfileHandle dst, Rect *myRect)
- FOURWORDINLINE(0x203c, 0x000C, 9, 0xABEE);
- extern pascal void EnableMatching(Boolean enableIt)
- FOURWORDINLINE(0x203c, 0x0002, 13, 0xABEE);
- extern pascal CMError ConcatenateProfiles(CMProfileHandle thru, CMProfileHandle dst, CMProfileHandle *newDst)
- FOURWORDINLINE(0x203c, 0x000C, 12, 0xABEE);
- extern pascal void GetProfileName(CMProfileHandle myProfile, IString *IStringResult)
- FOURWORDINLINE(0x203c, 0x0008, 14, 0xABEE);
- extern pascal long GetProfileAdditionalDataOffset(CMProfileHandle myProfile)
- FOURWORDINLINE(0x203c, 0x0004, 15, 0xABEE);
- extern pascal CMError CWNewColorWorld(CWorld *myCWorld, CMProfileHandle src, CMProfileHandle dst)
- FOURWORDINLINE(0x203c, 0x000C, 0, 0xABEE);
- extern pascal void CWDisposeColorWorld(CWorld myCWorld)
- FOURWORDINLINE(0x203c, 0x0004, 1, 0xABEE);
- extern pascal CMError CWMatchColors(CWorld myCWorld, CMColorList myColors, long count)
- FOURWORDINLINE(0x203c, 0x000c, 2, 0xABEE);
- extern pascal CMError CWCheckColors(CWorld myCWorld, CMColorList myColors, long count, CMGamutResult result)
- FOURWORDINLINE(0x203c, 0x0010, 3, 0xABEE);
- extern pascal CMError CWMatchPixMap(CWorld myCWorld, PixMap *myPixMap, PixMapCallBackUPP progressProc, long refCon)
- FOURWORDINLINE(0x203c, 0x0010, 4, 0xABEE);
- extern pascal CMError CWCheckPixMap(CWorld myCWorld, PixMap *myPixMap, PixMapCallBackUPP progressProc, long refCon, BitMap *resultBitMap)
- FOURWORDINLINE(0x203c, 0x0014, 7, 0xABEE);
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-
-